package com.junjie.base.tool;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 获取配置文件数据
 *
 * @Author Jun jie Yi
 * @Date 2022/3/7 17:07
 */
public class PropertiesUtil {
    private static InputStream inputStream = PropertiesUtil.class.getClassLoader().getResourceAsStream("application.properties");
    private static Properties properties = new Properties();

    public static String getProperty(String args) {
        try {
            properties.load(inputStream);
            properties.list(System.out);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return properties.getProperty(args);
    }
}
